<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://java.sun.com/jsf/html">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="/js/userInfo.js"></script>
    <th:block th:include="common.html :: source"></th:block>
</head>
<body>

<th:block th:include="common.html :: header"></th:block>

<div class="i_bg bg_color">
    <div class="m_content">

        <div class="m_left">
            <div class="left_n">管理中心</div>
            <div class="left_m">
                <div class="left_m_t t_bg1">订单中心</div>
                <ul>
                    <li><a href="/user/orderList" >我的订单</a></li>
                </ul>
            </div>
            <div class="left_m">
                <div class="left_m_t t_bg2">会员中心</div>
                <ul>
                    <li><a href="#" >用户信息</a></li>
                    <li><a href="/user/addressList" >地址管理</a></li>
                </ul>
            </div>
        </div>

        <div class="m_right" id="content">
            <div class="m_des">
                <table border="0" style="width:870px; line-height:22px;" cellspacing="0" cellpadding="0">
                    <tr valign="top">
                        <td width="115"><img th:src="'/images/'+${session.user.fileName}" width="90" height="90" /></td>
                        <td>
                            <div class="m_user" th:text="${session.user.userName}"></div><br />
                            <p>
                                性别:
                                <span th:if="${session.user.gender==1}">男</span>
                                <span th:if="${session.user.gender==0}">女</span>
                                <br /><br />
                                邮箱:
                                <span th:text="${session.user.email}"></span><br /><br />
                                电话:
                                <span th:text="${session.user.mobile}"></span><br /><br />
                                <button onclick="updateInfoBtn()" >修改</button><br /><br />
                            </p>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="m_des" id="updateInfo" style="display: none">
                <table border="0" style="width:870px; line-height:22px;" cellspacing="0" cellpadding="0">
                    <p><small>修改用户信息</small></p>
                    <tr valign="top">
                        <td width="115">
                            <img th:src="'/images/'+${session.user.fileName}" width="90" height="90" />
                        </td>
                        <td>
                            <tr height="50">
                                <td align="right"><font color="#ff4e00">*</font>&nbsp;真实姓名 &nbsp;</td>
                                <td><input type="text" th:value="${session.user.userName}" name="userName" class="l_user" pattern="^[\u4e00-\u9fa5]+$" title="请输入正确的姓名" required/></td>
                            </tr>
                            <tr height="50">
                                <td align="right">&nbsp;邮箱 &nbsp;</td>
                                <td><input type="text" th:value="${session.user.email}" name="email" class="l_email" pattern="^\w+@\w+(\.\w+){1,2}$" title="请输入正确的邮箱" required/></td>
                            </tr>
                            <tr>
                                <td align="right">
                                </td>
                                <td>
                                    <span th:text="${emailError}" style="color: red;text-align: center"></span>
                                </td>
                            </tr>
                            <tr height="50">
                                <td align="right">&nbsp;手机 &nbsp;</td>
                                <td><input type="text" th:value="${session.user.mobile}" name="mobile" class="l_tel" pattern="^(13|15|18|19|16)\d{9}$" title="请输入正确的手机" required/></td>
                            </tr>
                            <tr>
                                <td align="right">
                                </td>
                                <td>
                                    <span th:text="${mobileError}" style="color: red;text-align: center"></span>
                                </td>
                            </tr>
                            <tr height="50">
                                <td><input type="hidden" th:value="${session.user.id}" name="id"></td>
                                <td align="center"><button onclick="updateInfo(this)" >提交</button><br /></td>
                            </tr>
                        </td>
                    </tr>

                </table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="common.html :: footer"></th:block>
<th:block th:include="common.html :: permit"></th:block>
</body>
</html>
